package com.br.aiops.schedule;

import com.br.aiops.counter.AlertLogCounter;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 两分钟执行一次
 */
@Component
public class TwoMinutesSchedule extends AbstractSchedule {

    @Override
    @Scheduled(cron = "0 */2 * * * ?")
    public void run() {
        runTask();
    }

    @Override
    protected void initCycle() {
        scheduleCycle = new ScheduleCycle(2);
    }

    @Override
    public List<AlertLogCounter> getCounts() {
        return getAlertLogCounters(2);
    }

}
